<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>牛牛商城-用户中心</title>
	<link rel="stylesheet" type="text/css" href="{{ static('css/reset.css') }}">
	<link rel="stylesheet" type="text/css" href="{{ static('css/main.css') }}">
    <script type="text/javascript" src="{{ static('js/vue-2.5.16.js') }}"></script>
    <script type="text/javascript" src="{{ static('js/axios-0.18.0.min.js') }}"></script>
</head>
<body>
	<div id="app">
	<div class="header_con" style="cursor: pointer;">
		<div class="header" v-cloak>
			<div class="welcome fl">欢迎来到牛牛商城!</div>
			<div class="fr">
                <div v-if="username" class="login_btn fl">
                    欢迎您：<em>[[ username ]]</em>
                    <span>|</span>
                    <a href="{{ url('users:logout') }}">退出</a>
                </div>
                <div v-else class="login_btn fl">
                    <a href="{{ url('users:login') }}">登录</a>
                    <span>|</span>
                    <a href="{{ url('users:register') }}">注册</a>
                </div>
				<div class="user_link fl">
					<span>|</span>
					<a href="{{ url('users:info') }}">用户中心</a>
					<span>|</span>
					<a href="{{ url('carts:info') }}">我的购物车</a>
					<span>|</span>
                    <a href="/orders/info/1">我的订单</a>
{#					<a href="user_center_order.html">我的订单</a>#}
				</div>
			</div>
		</div>
	</div>
	<div class="search_bar clearfix">
		<a href="{{ url('contents:index') }}" class="logo fl">
            <img src="{{ static('images/logo.png') }}"style="width:120px;height:100px;margin-left:80px;"></a>
		<div class="search_wrap fl">
			<form method="get" action="/search/" class="search_con" style="border-radius: 15px;">
                <input type="text" class="input_text fl" name="q" placeholder="搜索商品">
                <input type="submit" class="input_btn fr" name="" value="搜索" style="border-radius: 12px;cursor: pointer;">
            </form>
			<ul class="search_suggest fl">
				<li><a href="https://uland.taobao.com/sem/tbsearch?spm=a2e0b.20350158.1998559106.8.19f3468aBw7c3q&refpid=mm_26632258_3504122_32538762&keyword=%E9%98%BF%E7%8E%9B%E5%B0%BC&clk1=b97410d2f6947cb48f5e6cb9d182522a&upsId=b97410d2f6947cb48f5e6cb9d182522a&pid=mm_26632258_3504122_32538762&union_lens=recoveryid%3A201_11.170.87.36_5100233_1626270140072%3Bprepvid%3A201_11.27.3.176_5215617_1626312332372">阿玛尼s</a></li>
				<li><a href="https://uland.taobao.com/sem/tbsearch?spm=a2e0b.20350158.search.1&refpid=mm_26632258_3504122_32538762&keyword=%E6%BD%AE%E7%94%B7T%E6%81%A4&clk1=b97410d2f6947cb48f5e6cb9d182522a&upsId=b97410d2f6947cb48f5e6cb9d182522a&pid=mm_26632258_3504122_32538762&union_lens=recoveryid%3A201_11.170.87.36_5100233_1626270140072%3Bprepvid%3A201_11.132.118.249_5212084_1626313154283">潮男T恤</a></li>
				<li><a href="https://uland.taobao.com/sem/tbsearch?spm=a2e0b.20350158.search.1&refpid=mm_26632258_3504122_32538762&keyword=%E9%95%AD%E5%B0%84%E5%8C%85&clk1=b97410d2f6947cb48f5e6cb9d182522a&upsId=b97410d2f6947cb48f5e6cb9d182522a&pid=mm_26632258_3504122_32538762&union_lens=recoveryid%3A201_11.170.87.36_5100233_1626270140072%3Bprepvid%3A201_11.27.9.205_5218842_1626312854717">镭射包</a></li>
				<li><a href="https://uland.taobao.com/sem/tbsearch?spm=a2e0b.20350158.search.1&refpid=mm_26632258_3504122_32538762&keyword=%E8%99%8E%E7%9A%AE%E9%B8%A1%E7%88%AA&clk1=b97410d2f6947cb48f5e6cb9d182522a&upsId=b97410d2f6947cb48f5e6cb9d182522a&pid=mm_26632258_3504122_32538762&union_lens=recoveryid%3A201_11.170.87.36_5100233_1626270140072%3Bprepvid%3A201_11.27.24.10_5224018_1626313211094">虎皮鸡爪</a></li>
			</ul>
		</div>
	</div>
	<div class="main_con clearfix">
		<div class="left_menu_con clearfix">
			<h3>用户中心</h3>
			<ul>
				<li><a href="{{ url('users:info') }}">· 个人信息</a></li>
				<li><a href="{{ url('users:address') }}" class="active">· 收货地址</a></li>
                <li><a href="/orders/info/1">· 我的订单</a></li>
{#                <li><a href="user_center_order.html">· 全部订单</a></li>#}
                <li><a href="{{ url('users:pass') }}">· 修改密码</a></li>			</ul>
			</ul>
		</div>
        <div class="right_content clearfix" v-cloak>
            <div class="site_top_con">
                <a @click="show_add_site">
                    <button style="width:120px;height:40px;background-color:#FF0066;border:0;cursor: pointer;border-radius:12px;color:white;">新增收货地址</button>
                </a>
                <br>
                <span style="font-size:18px;">你已创建了<b>[[ addresses.length ]]</b>个收货地址，最多可创建<b>20</b>个</span>
            </div>
            <div class="site_con" v-for="(address, index) in addresses">
                <div class="site_title" >
                    <div v-if="edit_title_index===index">
                        <input v-model="new_title" type="text" name="" style="border-radius:12px;">
                        <input @click="save_title(index)" type="button" name="" value="保 存" style="border:0;cursor: pointer;border-radius:12px;width:50px;height:30px;background-color:#FF3366;color:white">
                        <input @click="cancel_title(index)" type="reset" name="" value="取 消" style="border:0;cursor: pointer;border-radius:12px;width:50px;height:30px;background-color:#E6E6FA;color:black">
                    </div>
                    <div>
                        <h3>[[ address.title ]]</h3>
                        <a @click="show_edit_title(index)" class="edit_title" style="cursor: pointer;"></a>
                    </div>
                    <em v-if="address.id==default_address_id">默认地址</em>
{#                    <em v-if="address.id===default_address_id">默认地址</em>#}
                    <span @click="delete_address(index)">×</span>
                </div>
                <ul class="site_list">
                    <li><span>收货人：</span><b>[[ address.receiver ]]</b></li>
                    <li><span>所在地区：</span><b>[[ address.province ]] [[address.city]] [[ address.district ]]</b></li>
                    <li><span>地址：</span><b>[[ address.place ]]</b></li>
                    <li><span>手机：</span><b>[[ address.mobile ]]</b></li>
                    <li><span>固定电话：</span><b>[[ address.tel ]]</b></li>
                    <li><span>电子邮箱：</span><b>[[ address.email ]]</b></li>
                </ul>
                <div class="down_btn">
                    <a v-if="address.id!=default_address_id" @click="set_default(index)" style="cursor: pointer;">设为默认</a>
{#                    <a @click="show_edit_site(index)" class="edit_icon">编辑</a>#}
                </div>
            </div>
        </div>
	</div>
	<div class="footer">
		<div class="foot_link">
			<a href="#">关于我们</a>
			<span>|</span>
			<a href="#">联系我们</a>
			<span>|</span>
			<a href="#">招聘人才</a>
			<span>|</span>
			<a href="#">友情链接</a>
		</div>
		<p>CopyRight © 2021 重庆勇敢牛牛商业股份有限公司 All Rights Reserved</p>
		<p>电话：5208208820    渝ICP备*******8号</p>
	</div>
	<div class="pop_con" v-show="is_show_edit" v-cloak>
		<div class="site_con site_pop">
            <div class="site_pop_title">
                <h3>新增收货地址</h3>
                <a @click="is_show_edit=false" style="cursor:pointer;">×</a>
            </div>
            <form>
                <div class="form_group">
                    <label><span style="color: red">*</span>&nbsp;收货人：</label>
                    <input v-model="form_address.receiver" @blur="check_receiver" type="text" class="receiver" style="border-radius:12px">
                    <span v-show="error_receiver" class="receiver_error">请填写收件人</span>
                </div>
                <div class="form_group">
                    <label><span style="color: red">*</span>&nbsp;所在地区：</label>
                    <select v-model="form_address.province_id" style="border-radius:12px">
                        <option v-for="province in provinces" :value="province.id">[[ province.name ]]</option>
                    </select>
                    <select v-model="form_address.city_id" style="border-radius:12px">
                        <option v-for="city in cities" :value="city.id">[[ city.name ]]</option>
                    </select>
                    <select v-model="form_address.district_id" style="border-radius:12px">
                        <option v-for="district in districts" :value="district.id">[[ district.name ]]</option>
                    </select>
                </div>
                <div class="form_group">
                    <label><span style="color: red">*</span>&nbsp;详细地址：</label>
                    <input v-model="form_address.place" @blur="check_place" type="text" class="place" style="border-radius:12px">
                    <span v-show="error_place" class="place_error">请填写地址信息</span>
                </div>
                <div class="form_group">
                    <label><span style="color: red">*</span>&nbsp;手机：</label>
                    <input v-model="form_address.mobile" @blur="check_mobile" type="text" class="mobile" style="border-radius:12px">
                    <span v-show="error_mobile" class="mobile_error">手机信息有误</span>
                </div>
                <div class="form_group">
                    <label>固定电话：</label>
                    <input v-model="form_address.tel" @blur="check_tel" type="text" class="tel" style="border-radius:12px">
                    <span v-show="error_tel" class="tel_error">固定电话有误</span>
                </div>
                <div class="form_group">
                    <label>邮箱：</label>
                    <input v-model="form_address.email" @blur="check_email" type="text" class="email" style="border-radius:12px">
                    <span v-show="error_email" class="email_error">邮箱信息有误</span>
                </div>
                <input @click="save_address" type="button" name="" value="新 增" class="info_submit" style="width:60px;height:30px;background-color:#FF3366;border:0;cursor: pointer;border-radius:12px;color:white;">
                <input @click="is_show_edit=false" type="reset" name="" value="取 消" class="info_submit info_reset" style="width:60px;height:30px;background-color:#E6E6FA;border:0;cursor: pointer;border-radius:12px;color:black;">
            </form>
		</div>
		<div class="mask"></div>
	</div>
	</div>
    <script type="text/javascript">
		let addresses = {{ addresses | safe }};
		let default_address_id = "{{ default_address_id }}";
        {#let default_address_id = {{ default_address_id }};#}
    </script>
	<script type="text/javascript" src="{{ static('js/common.js') }}"></script>
	<script type="text/javascript" src="{{ static('js/user_center_site.js') }}"></script>
</body>
</html>